package cn.tedu.sp02.service;

import cn.tedu.sp01.pojo.Item;
import cn.tedu.sp01.service.ItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.LinkedList;
import java.util.List;

@Service
@Slf4j
public class ItemServicelmpl implements ItemService {
    @Override
    public List<Item> getItems(String orderId) {
        List<Item> list = new LinkedList<>();
        list.add(new Item(1,"商品1",1));
        list.add(new Item(2,"商品2",2));
        list.add(new Item(3,"商品3",3));
        list.add(new Item(4,"商品4",4));
        list.add(new Item(5,"商品5",5));
        return list;

    }

    @Override
    public void decreaseNumber(List<Item> items) {
        for (Item item: items) {
            log.info("减少商品库存："+item);
        }

    }
}
